package logs

type Level uint8

const (
	LevelEmergency Level = iota
	LevelAlert
	LevelCritical
	LevelError
	LevelWarning
	LevelNotice
	LevelInformational
	LevelDebug
)

type Separate string

const (
	SeparateEmergency Separate = "emergency"
	SeparateCritical  Separate = "critical"
	SeparateError     Separate = "error"
	SeparateWarning   Separate = "warning"
	SeparateInfo      Separate = "info"
	SeparateDebug     Separate = "debug"
)

type Config struct {
	Level    Level      `json:"level"`
	Console  bool       `json:"-"`
	Filename string     `json:"filename"`
	Separate []Separate `json:"separate"`
	Rotate   bool       `json:"rotate"`

	// Rotate at line
	MaxLines int `json:"maxlines"`
	// Rotate at size
	MaxSize int `json:"maxsize"` // 单位: B
	// Rotate at size count
	MaxFiles int `json:"maxfiles"` // 日志文件个数, 达到最大个数后不在产生新的日志文件, 在设定MaxLines 或 MaxSize 时, MaxFiles为必填项

	// Rotate daily
	Daily   bool  `json:"daily"`
	MaxDays int64 `json:"maxdays"`

	// Rotate hourly
	Hourly   bool  `json:"hourly"`
	MaxHours int64 `json:"maxhours"`
}
